package com.fenghuajueli.module_user.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.fenghuajueli.libbasecoreui.listener.OnListClickListener;
import com.fenghuajueli.module_user.R;
import com.fenghuajueli.module_user.databinding.SelectPayWaysDialogLayoutBinding;

public class SelectPayWaysDialog extends BaseFullScreenBottomDialog {

    private OnListClickListener<Integer> onPayWaysListener;//0选择微信 1选择支付宝

    SelectPayWaysDialogLayoutBinding binding;

    public SelectPayWaysDialog(Context context) {
        super(context, R.style.StyleBaseDialog);
    }

    public void setOnPayWaysListener(OnListClickListener<Integer> onPayWaysListener) {
        this.onPayWaysListener = onPayWaysListener;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = SelectPayWaysDialogLayoutBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        binding.tvWxpay.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (onPayWaysListener != null) {
                    onPayWaysListener.itemClick(0, 0);
                }
            }
        });
        binding.tvZfbpay.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (onPayWaysListener != null) {
                    onPayWaysListener.itemClick(0, 1);
                }
            }
        });
    }


}
